<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('训练报告')"/>
    <th:block th:include="include :: select2-css"/>
    <th:block th:include="include :: bootstrap-select-css" />
    <th:block th:include="include :: datetimepicker-css" />
    <style>
        .ttd {
            height: 60px;
        }
        .tc{
            text-align: center;
            width: 25%;
        }
        .logo_box{
            width: 60%;
            margin: 0 auto;
        }
        .logo_box img{
            width: 100%;
            height: 100%;
        }
    </style>
</head>
<body>
<div>
    <div>
        <input id="childId" name="childId"  th:value="*{childId}" hidden="true">
        <input id="scheduleTime" name="scheduleTime"  th:value="*{scheduleTime}" hidden="true">
        <div id="trainReport" >
            <div style="text-align: center; margin-top: 8px"><img src="https://oies.oss-cn-shanghai.aliyuncs.com/OTO/oto_logo_corlor.png" alt="" style="width: 690px"/></div>
            <div style="text-align: center;font-weight:bold; font-size:18px; margin-top: 10px;margin-bottom: 10px"><span id="hTitle">学员训练报告</span></div>
            <table border="1" style="border-collapse: collapse;width: 40%;margin: 0 auto;text-align: left;">
                <tr style="height: 60px;">
                    <th style="padding-left: 15px;" id="resName">姓名：</th>
                    <th style="padding-left: 15px;" id="resAge">生理年龄：</th>
                    <th style="padding-left: 15px;" id="resTime">使用时间：</th>
                </tr>
            </table>
            <table border="1" style="border-collapse: collapse;width: 40%;margin: 20px auto 0;text-align: center;">
                <tr class="ttd">
                    <td>课程分类</td>
                    <td colspan="2">训练目标</td>
                    <td>训练项目</td>
                    <td>达成情况</td>
                </tr>
                <tr>
                    <td rowspan="3" class="ttd">
                        <p>感知觉与运动</p>
                        <p id="teacher1">责任老师：</p>
                    </td>
                    <td colspan="2" class="ttd">感觉与知觉</td>
                    <td class="ttd" id="program1"></td>
                    <td class="ttd" id="rate1"></td>
                </tr>
                <tr>
                    <td colspan="2" class="ttd">大运动技能</td>
                    <td class="ttd" id="program2"></td>
                    <td class="ttd" id="rate2"></td>
                </tr>
                <tr>
                    <td colspan="2" class="ttd">精细动作</td>
                    <td class="ttd" id="program3"></td>
                    <td class="ttd" id="rate3"></td>
                </tr>
                <tr>
                    <td rowspan="4" class="ttd tc">
                        <p>言语与语言</p>
                        <p id="teacher2">责任老师：</p>
                    </td>
                    <td colspan="2" class="ttd">言语功能</td>
                    <td class="ttd" id="program6"></td>
                    <td class="ttd" id="rate6"></td>
                </tr>
                <tr>
                    <td rowspan="2" class="ttd">语言表达</td>
                    <td class="ttd" >语言</td>
                    <td class="ttd" id="program7"></td>
                    <td rowspan="2" class="ttd" id="rate7"></td>
                </tr>
                <tr>
                    <td class="ttd">句式</td>
                    <td class="ttd" id="program8"></td>

                </tr>
                <tr>
                    <td colspan="2" class="ttd">社交互动</td>
                    <td class="ttd" id="program9"></td>
                    <td class="ttd" id="rate8"></td>
                </tr>
                <tr>
                    <td rowspan="2" class="ttd tc">
                        <p>认知</p>
                        <p id="teacher3">责任老师：</p>
                    </td>
                    <td colspan="2" class="ttd">基础认知</td>
                    <td class="ttd" id="program4"></td>
                    <td class="ttd" id="rate4"></td>
                </tr>
                <tr>
                    <td colspan="2" class="ttd">认知能力</td>
                    <td class="ttd" id="program5"></td>
                    <td class="ttd" id="rate5"></td>
                </tr>
            </table>
        </div>
    </div>

</div>
<th:block th:include="include :: footer"/>
<th:block th:include="include :: select2-js"/>
<th:block th:include="include :: bootstrap-select-js" />
<th:block th:include="include :: datetimepicker-js" />
<script th:inline="javascript">
    var editPrefix = ctx + "education/trainingReport";
    $(function(){
        searchReport();
    });

    function searchReport(){
        var childId = $('#childId').val();
        if(!childId){
            $.modal.alertWarning("学生ID为空");
            return;
        }
        var scheduleTime = $('#scheduleTime').val();
        var formData = new FormData();
        formData.set("trainingProgramNumber",scheduleTime);
        formData.set("childId", childId);
        var selectIndex = window.parent.document.getElementById('parentSchoolList').selectedIndex;
        if (selectIndex >= 0) {
            var centerId = window.parent.document.getElementById('parentSchoolList').options[selectIndex].value;
            formData.set("centerId", centerId);
        }
        $.ajax({
            url: editPrefix+"/findTrainingReport",
            type: "post",
            data: formData,
            cache: false,
            processData: false,
            contentType: false,
            success: function (result) {
                if (result.code == '0') {
                    var content = result.data;
                    var resName = "姓名："+content.childName;
                    var resAge = "生理年龄："+content.childAge;
                    var resTime = "使用时间："+scheduleTime;
                    var teacher1 = "责任老师："+content.teacherName1;
                    var teacher2 = "责任老师："+content.teacherName2;
                    var teacher3 = "责任老师："+content.teacherName3;

                    var rate1 = content.rateStr1;
                    var rate2 = content.rateStr2;
                    var rate3 = content.rateStr3;
                    var rate4 = content.rateStr4;
                    var rate5 = content.rateStr5;
                    var rate6 = content.rateStr6;
                    var rate7 = content.rateStr7;
                    var rate8 = content.rateStr8;
                    $('#hTitle').text("学员"+content.childName+content.monthTime+"训练报告");
                    $('#resName').text(resName);
                    $('#resAge').text(resAge);
                    $('#resTime').text(resTime);
                    $('#teacher1').text(teacher1);
                    $('#teacher2').text(teacher2);
                    $('#teacher3').text(teacher3);
                    $('#rate1').html(rate1)
                    $('#rate2').html(rate2);
                    $('#rate3').html(rate3);
                    $('#rate4').html(rate4);
                    $('#rate5').html(rate5);
                    $('#rate6').html(rate6);
                    $('#rate7').html(rate7);
                    $('#rate8').html(rate8);
                    $('#program1').html(content.program1);
                    $('#program2').html(content.program2);
                    $('#program3').html(content.program3);
                    $('#program4').html(content.program4);
                    $('#program5').html(content.program5);
                    $('#program6').html(content.program6);
                    $('#program7').html(content.program7);
                    $('#program8').html(content.program8);
                    $('#program9').html(content.program9);
                    // $('#hide').style.display = "block";
                } else {
                    // $('#hide').style.display = "none";
                    $.modal.alertWarning(result.msg);

                }
            }
        })

    }

</script>
</body>

</html>